﻿using DigitalHealth.PACS.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace DigitalHealth.PACS.ChatWebSocket.Services
{
    public interface IChatServer
    {
        /// <summary>
        /// 获取聊天记录(websocket中间件使用)
        /// </summary>
        /// <param name="chatServerContext"></param>
        /// <returns></returns>
        IEnumerable<MsgTemplate> GetChatMessages(ChatServerContext chatServerContext);
        /// <summary>
        /// 获取未读聊天记录(websocket中间件使用)
        /// </summary>
        /// <param name="chatServerContext"></param>
        /// <returns></returns>
        IEnumerable<MsgTemplate> GetNotReadChatMessages(ChatServerContext chatServerContext);
        /// <summary>
        /// 获取历史聊天记录
        /// </summary>
        /// <param name="receiverUserId"></param>
        /// <returns></returns>
        IEnumerable<MsgTemplate> GetHistoryChatMessage(string receiverUserId);
        /// <summary>
        /// 获取历史群聊记录
        /// </summary>
        /// <param name="groupId"></param>
        /// <returns></returns>
        IEnumerable<MsgTemplate> GetGroupHistoryChatMessage(string groupId);
        /// <summary>
        /// 根据用户ID获取未读记录
        /// </summary>
        /// <param name="receiverUserId"></param>
        /// <returns></returns>
        IEnumerable<MsgTemplate> GetNotReadChatMessage(string receiverUserId);
        /// <summary>
        /// 根据用户ID获取群聊未读记录
        /// </summary>
        /// <param name="groupId"></param>
        /// <returns></returns>
        IEnumerable<MsgTemplate> GetNotReadGroupChatMessage(string receiverUserId);
        void Create(ChatServerContext chatServerContext);
        void Update(ChatServerContext chatServerContext);
        void Delete(ChatServerContext chatServerContext);
        bool ChatMessageExists(ChatServerContext chatServerContext);
    }
}
